@import "./nice-dark/codeblock.xydark.css";

@font-face {
  font-family: "Fira Mono";
  font-style: normal;
  font-weight: normal;
  src: local("Fira Mono Regular"), url("./notes-dark/FiraMono-Regular.ttf") format("truetype");
}

@font-face {
  font-family: "Fira Mono";
  font-style: normal;
  font-weight: bold;
  src: local("Fira Mono Bold"), url("./notes-dark/FiraMono-Bold.ttf") format("truetype");
}

:root {
  --primary-color: #87ceeb;
  --primary-color-rgb: 252, 186, 3;

  --bg-color: #292929;
  --bg-color-dark: #1f1f1f;
  --dark-trait: #141414;
  --light-trait-100: #3d3d3d;
  --light-trait-200: #545454;
  --light-trait-300: #777;
  --light-trait-400: #8c8c8c;

  --text-color: #f8f8f2;
  --text-color-secondary: #d2d3d3;
  --text-highlight-color: #fff;
  --text-highlight-bg: rgba(var(--primary-color-rgb), 0.3);
  --select-text-bg-color: rgba(255, 255, 255, 0.2);
  --search-select-text-color: var(--text-highlight-color);
  --search-select-bg-color: var(--text-highlight-bg);

  --code-color: #f3b3f8;

  --border-radius: 3px;

  --font-size: 16px;

  --font-family: Inter, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen, Ubuntu, Cantarell, "Fira Sans", "Droid Sans", "Helvetica Neue", sans-serif;
  /* --font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Ubuntu, "Helvetica Neue", sans-serif; */
  --monospace: "Fira Mono", "Cousine", "Consolas", monospace;

  --heading-char-color: var(--light-trait-400);
  --color-popover-bg-color: var(--text-color);
  --rawblock-edit-panel-bd: var(--bg-color-dark);
  --control-text-color: var(--text-color);
  --meta-content-color: var(--primary-color);
  --primary-btn-border-color: var(--primary-color);
  --side-bar-bg-color: var(--bg-color-dark);
  --item-hover-bg-color: var(--bg-color);
  --item-hover-text-color: var(--text-highlight-color);
  --active-file-bg-color: var(--bg-color);
  --active-file-border-color: var(--bg-color);
  --window-border: 1px solid var(--bg-color);
  --focus-ring-color: transparent;
  --table-bg-darker-color: var(--bg-color-dark);
  --table-bg-color: var(--bg-color);
}

html {
  font-size: var(--font-size);
}

body {
  font-family: var(--font-family);
  -webkit-font-smoothing: antialiased;
  color: var(--text-color);
  line-height: 1.6;
}

/* 设置中间区域背景色 */
content {
  background-color: #1a1a1a;
}

#write {
  max-width: 860px;
  margin: 0 auto;
  padding: 30px;
  padding-right: 300px;
  padding-bottom: 100px;
}

@media only screen and (min-width: 1400px) {
  #write {
    max-width: 1024px;
  }
}

@media only screen and (max-width: 1400px) {
  #write {
    padding-right: 0px;
  }
}

@media only screen and (min-width: 1800px) {
  #write {
    max-width: 1200px;
  }
}

#write>ul:first-child,
#write>ol:first-child {
  margin-top: 30px;
}

.cm-s-inner .cm-string {
  color: #89dddc;
}

.cm-s-inner .cm-property {
  color: #c792de;
}

a {
  color: var(--primary-color);
  transition: 0.5s;
}

a:hover {
  color: #f1c0cb;
}

h1,
h2,
h3,
h4,
h5,
h6 {
  position: relative;
  margin-top: 1rem;
  margin-bottom: 1rem;
  font-weight: bold;
  line-height: 1.4;
  cursor: text;
}

h1:hover a.anchor,
h2:hover a.anchor,
h3:hover a.anchor,
h4:hover a.anchor,
h5:hover a.anchor,
h6:hover a.anchor {
  text-decoration: none;
}

h1 tt,
h1 code,
h2 tt,
h2 code,
h3 tt,
h3 code,
h4 tt,
h4 code,
h5 tt,
h5 code,
h6 tt,
h6 code {
  font-size: inherit;
}

h1 {
  padding-bottom: 0.3em;
  font-size: 2.2em;
  line-height: 1.3;
}

h1::before {
  content: "🎉";
}

h2 {
  padding-bottom: 0.3em;
  font-size: 1.75em;
  line-height: 1.225;
  margin-top: 1.2em;
  padding-top: 1em;
  border-top: 3px solid #363636;
}

h2::before {
  content: "✨";
}

h3 {
  font-size: 1.4em;
  line-height: 1.43;
}

h3::before {
  content: "🔖";
}

h4 {
  font-size: 1.2em;
}

h5 {
  font-size: 1em;
}

h6 {
  font-size: 1em;
  color: var(--light-trait-300);
}

p,
blockquote,
ul,
ol,
dl,
table {
  margin: 0.8em 0;
}

li>ol,
li>ul {
  margin: 0 0;
}

hr {
  height: 2px;
  padding: 0;
  margin: 16px 0;
  background-color: var(--light-trait-100);
  border: 0 none;
  overflow: hidden;
  box-sizing: content-box;
}

sup.md-footnote {
  background-color: var(--light-trait-400);
  color: var(--light-trait-100);
}

li p.first {
  display: inline-block;
}

ul,
ol {
  padding-left: 30px;
}

ul:first-child,
ol:first-child {
  margin-top: 0;
}

ul:last-child,
ol:last-child {
  margin-bottom: 0;
}

mark,
.ty-file-search-match-text,
.md-search-hit {
  background: var(--search-select-bg-color);
  color: var(--search-select-text-color);
}

.md-search-hit * {
  color: var(--search-select-text-color);
}

.cm-search-hit.CodeMirror-selectedtext,
.md-search-hit.md-search-select,
.md-search-select {
  outline: 2px solid var(--primary-color);
}

.typora-sidebar-resizer-bar {
  width: 1em;
  background-color: #424242;
}

blockquote {
  margin-left: -14px;
  margin-right: -14px;
  border-radius: var(--border-radius);
  border-left: 4px solid var(--light-trait-300);
  background-color: var(--light-trait-100);
  padding: 7px 14px 7px 10px;
}

blockquote blockquote {
  padding-right: 0;
}

table {
  padding: 0;
  word-break: initial;
}

table tr {
  border-top: 1px solid var(--dark-trait);
  margin: 0;
  padding: 0;
}

table tr:nth-child(2n),
thead {
  background-color: var(--side-bar-bg-color);
}

table tr th {
  font-weight: bold;
  border: 1px solid var(--dark-trait);
  border-bottom: 0;
  margin: 0;
  padding: 6px 13px;
}

table tr td {
  border: 1px solid var(--dark-trait);
  margin: 0;
  padding: 6px 13px;
}

table tr th:first-child,
table tr td:first-child {
  margin-top: 0;
}

table tr th:last-child,
table tr td:last-child {
  margin-bottom: 0;
}

kbd {
  font-size: 0.875rem;
  background: var(--bg-color-dark);
  border: 1px solid var(--dark-trait);
  box-shadow: 0 2px 0 var(--dark-trait);
  color: var(--text-color-secondary);
}

.md-fences,
code,
tt {
  border: 1px solid var(--dark-trait);
  background-color: var(--bg-color-dark);
  border-radius: var(--border-radius);
  padding: 2px 4px 0px 4px;
  font-size: 0.9em;
  font-family: var(--monospace);
}

code {
  padding: 3px 4px !important;
  border-radius: 5px;
  color: #8ec8e4;
  background-color: #333437;
}

.md-fences {
  margin-bottom: 15px;
  margin-top: 15px;
  padding-top: 8px;
  padding-bottom: 6px;
  background-color: var(--side-bar-bg-color);
}

#write pre.md-meta-block {
  padding: 1rem;
  font-size: 85%;
  line-height: 1.45;
  background-color: var(--bg-color-dark);
  border: 0;
  border-radius: var(--border-radius);
  color: var(--light-trait-400);
  margin-top: 0 !important;
}

#write .mathjax-block .md-rawblock-tooltip {
  border-top-left-radius: var(--border-radius);
  border-top-right-radius: var(--border-radius);
}

#write .mathjax-block .md-math-container {
  border-top-left-radius: var(--border-radius);
  border-bottom-right-radius: var(--border-radius);
  border-bottom-left-radius: var(--border-radius);
}

#write .md-mathblock-panel .md-rawblock-control:first-of-type {
  border-top-left-radius: var(--border-radius);
}

.md-mathjax-midline {
  background-color: var(--bg-color);
  color: var(--text-color);
}

.md-inline-math script {
  color: var(--code-color);
}

code {
  padding: 0 2px 0 2px;
}

.CodeMirror-lines {
  padding-left: 4px;
}

.code-tooltip {
  box-shadow: none;
  border-radius: var(--border-radius);
}

#write .code-tooltip {
  bottom: initial;
  top: 100%;
  left: initial;
  right: -1px;
  background: var(--bg-color-dark);
  border: 1px solid var(--dark-trait);
  border-top-left-radius: 0;
  border-top-right-radius: 0;
  border-top: 0;
  font-family: var(--monospace);
}

#write .md-mathblock-panel .code-tooltip {
  right: 0;
  border: none;
}

#write .md-task-list-item>input {
  -webkit-appearance: initial;
  display: block;
  position: absolute;
  border: 1px solid var(--light-trait-200);
  border-radius: 50%;
  margin-left: -1.8rem;
  height: 1.2rem;
  width: 1.2rem;
  transition: background 0.3s;
}

#write .md-task-list-item>input:focus {
  outline: none;
  box-shadow: none;
}

#write .md-task-list-item>input[checked] {
  background: var(--primary-color);
  border: 1px solid var(--primary-color);
}

#write .md-task-list-item>input[checked]::before {
  content: "✓";
  position: absolute;
  top: 0;
  left: 0;
  height: 100%;
  width: 100%;
  text-align: center;
  color: var(--dark-trait);
  font-size: 12px;
  font-weight: 500;
}

.md-image>.md-meta {
  border-radius: var(--border-radius);
  padding: 2px 0px 0px 4px;
  font-size: 0.9em;
  color: inherit;
}

.md-toc {
  margin-top: 20px;
  padding-bottom: 20px;
}

/* Source mode */
.CodeMirror.cm-s-typora-default *,
.cm-s-typora-default * {
  background: inherit;
  color: var(--text-color);
  font-family: var(--monospace);
  font-size: var(--font-size) !important;
  font-style: normal;
  font-weight: normal;
}

.CodeMirror.cm-s-typora-default div.CodeMirror-cursor {
  border-left: 2px solid var(--light-trait-400);
}

/* 不限制内容的最小宽度 */
.sidebar-content-content {
  min-width: 0;
}

/* 宽度较小时，关闭右侧大纲 */
@media only screen and (max-width: 1400px) {
  .sidebar-content .outline-content {
    display: none !important;
  }
}

/* 移动大纲至右侧，宽度足够时显示 */
@media only screen and (min-width: 1400px) {
  .sidebar-content .outline-content {
    width: 300px;
    word-wrap: break-word;
    word-break: break-all;
    position: fixed !important;
    padding: 20px 10px 100px 10px;
    top: 40px;
    right: 50px;
    display: block !important;
    transition: 0.5s;
    z-index: 9999;
  }
}

/** 设置content为空值，不然会遮住大纲 */
#typora-sidebar {
  contain: none;
}

/** 去除底部border */
.sidebar-tabs {
  border-bottom: none;
}

/* 关闭文件大纲切换 */
/* .info-panel-tab-wrapper {
  display: none;
} */

/* 关闭滚动时高度变化 */
/* .ty-show-search #file-library-tree {
  padding-top: 0;
} */

/* 文件列表距离顶部高度 */
/* .native-window .sidebar-content {
  top: 24px;
} */

/* 不显示查看文件输入框 */
/* #file-library-search {
  display: none;
} */

/* 当前大纲标题的高亮颜色 */
.outline-children .outline-active {
  color: skyblue;
  padding-left: 0.3em;
}

.outline-item {
  display: flex;
  margin: 0.3rem 0px;
  font-size: 16px;
}

/* 当前大纲所在标题的前缀图标 */
.outline-item-active.outline-item::before {
  content: "🔥" !important;
}

.outline-item-active {
  padding-left: 3.05em;
}

.outline-item:hover {
  padding-left: 3.05em !important;
  padding-right: 1.9em;
  border: none;
}

.outline-item.select,
.ty-search-item-line.select,
.ty-search-item.select {
  outline-width: 2px;
}

.outline-item.select {
  outline-offset: 0px;
}

.outline-h1>.outline-item {
  padding-left: 1.3em;
  pointer-events: none;
}

.outline-h1 .outline-item:first-child {
  font-weight: 700;
}

.outline-h1>.outline-item-active.outline-item::before {
  content: "" !important;
  font-size: 18px;
}

.outline-h2 {
  margin-top: 0.7em;
}

.outline-h2>.outline-item {
  padding-left: 1.3em;
  font-size: 15px;
  color: #959595;
}

/* 大纲标题前缀图标 */
.outline-h2>.outline-item::before {
  content: "📝";
}

/* 大纲只显示一二标题 */
.outline-h3,
.outline-h4,
.outline-h5,
.outline-h6 {
  display: none;
}

/* h3.md-focus:before,
.md-focus:before,
.md-focus:before,
.md-focus:before {
  color: inherit !important;
  color: inherit !important;
  border: none !important;
  border-radius: 3px !important;
  position: initial !important;
  left: 0rem !important;
  top: 0rem !important;
  float: none !important;
  font-size: 23px !important;
  padding-left: 0px !important;
  padding-right: 0px !important;
  vertical-align: initial !important;
  font-weight: initial !important;
  line-height: normal !important;
}
h3.md-focus:before,
h4.md-focus:before,
h5.md-focus:before,
h6.md-focus:before {
  content: none;
} */

.outline-expander {
  width: 1.5rem;
  vertical-align: initial;
}

.outline-expander:before,
.outline-expander:hover:before,
.outline-item-open>.outline-item>.outline-expander:before,
.outline-item-open>.outline-item>.outline-expander:hover:before {
  content: "\f125";
  transition: transform 125ms ease-in-out;
}

.outline-item-open>.outline-item>.outline-expander:hover:before,
.outline-item-open>.outline-item>.outline-expander:before {
  transform: rotate(90deg);
}

.outline-label {
  word-break: break-all;
}

.outline-label:hover {
  word-break: break-all;
  text-decoration: none;
}

#toc-dropmenu {
  background: var(--bg-color-dark);
}

#toc-dropmenu .outline-title {
  font-size: 1rem;
  text-transform: uppercase;
}

.dropdown-menu .divider {
  display: none;
}

.context-menu {
  background-color: var(--bg-color-dark);
}

.file-node-background {
  height: 31px;
}

.file-node-content:hover .file-node-icon,
.file-node-content:hover .file-node-open-state {
  visibility: visible;
}

.file-node-icon {
  margin-right: 8px;
}

.file-library-node:not(.file-node-root):focus>.file-node-content {
  outline: none;
}

.blink-area {
  animation: none;
}

.file-list-item-summary {
  font-size: var(--font-size);
  font-family: var(--font-family);
}

#md-searchpanel input {
  border-radius: var(--border-radius);
  box-shadow: none;
}

#md-searchpanel input:focus {
  box-shadow: none;
  border-color: var(--meta-content-color);
}

#md-searchpanel .search-type-selection {
  width: auto;
}

#md-searchpanel .btn:not(.close-btn):hover {
  box-shadow: none;
}

.mac-seamless-mode #typora-sidebar {
  background-color: var(--side-bar-bg-color);
}

#md-notification .btn {
  border: 0;
}

.megamenu-menu {
  background-color: var(--bg-color-dark);
}

.megamenu-opened header {
  background-image: none;
}

.megamenu-content,
.megamenu-opened header {
  background: var(--bg-color);
}

.megamenu-opened .megamenu-content {
  visibility: visible;
  opacity: 1;
  animation: none;
  background-color: inherit;
}

#recent-file-panel tbody tr:nth-child(2n) {
  background-color: var(--table-bg-darker-color);
}

#recent-file-panel tbody tr:nth-child(2n + 1) {
  background-color: var(--table-bg-color);
}

#recent-file-panel-action-btn {
  background-color: var(--bg-color);
}

.long-btn:hover {
  background-color: var(--item-hover-bg-color);
  color: var(--item-hover-text-color) !important;
}

#recent-file-panel-action-btn:hover {
  background-color: var(--item-hover-bg-color);
  color: var(--item-hover-text-color) !important;
}

.mouse-entered #top-titlebar .toolbar-icon.btn:hover,
.mouse-entered #top-titlebar .toolbar-icon.btn.hover {
  background-color: var(--item-hover-bg-color);
}

#m-import-local:hover .preference-item-hint {
  color: var(--item-hover-text-color);
}

.typora-sourceview-on #toggle-sourceview-btn {
  background-color: var(--bg-color-dark);
}